package com.croofr.dao.service.implementation.database.transformer;

import com.croofr.dao.service.ValueTransformer;

/**
 * User: bednar
 * Date: Mar 28, 2010
 * Time: 10:41:22 AM
 */
public class OracleValueTransformer implements ValueTransformer
{
    @Override
    public Long transformValue(Long value)
    {
        return value;
    }

    @Override
    public String transformValue(String value)
    {
        return "'" + value + "'";
    }

    @Override
    public Object transformValue(Object value)
    {

        if (String.class.isAssignableFrom(value.getClass()))
        {
            return transformValue((String) value);
        }

        if (Long.class.isAssignableFrom(value.getClass()))
        {
            return transformValue((Long) value);
        }

        return value;
    }
}
